import React from 'react'
import WithTime from '../views/HOC/WithTime'
import PropsChildren from './Children'

function Repeat(props: { count: number; children: any }) {
    let itemList = [];
    for (let i = 0; i < props.count; i++) {
        itemList.push(props.children(i))
    }
    return <div>{itemList}</div>
}
const Jsx = (props: { time: any }) => {
    return (
        <>
            <Repeat count={10}>
                {(i: number) => <li key={i}>This is item {i} in the list</li>}
            </Repeat>
            <h2>{props.time.toLocaleString()}</h2>
            <PropsChildren />
        </>
    )
}

export default WithTime(Jsx);